-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19871 Drop JUnit 4 usage in Hibernate Envers #11131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
have you tried this one: (Last time I've played around with this it had some strange behavior, but I don't remember the sepcifics anymore 🙂) |
|
Hey @marko-bekhta, yes I saw that (there's also this) but I'm not sure how that would help - |
|
Ah I meant to use the other pair of anotations in the evnerse test classes rather than |
...org/hibernate/orm/test/envers/integration/query/AssociationRevisionsOfEntitiesQueryTest.java
Dismissed
Show dismissed
Hide dismissed
|
As discussed offline, there are a few alternatives to improve on the |
dfd4d86 to
798f410
Compare
.../src/test/java/org/hibernate/orm/test/envers/integration/auditReader/AuditReaderAPITest.java
Fixed
Show fixed
Hide fixed
...test/java/org/hibernate/orm/test/envers/integration/basic/BasicTypeColumnDefinitionTest.java
Fixed
Show fixed
Hide fixed
...test/java/org/hibernate/orm/test/envers/integration/basic/BasicTypeColumnDefinitionTest.java
Fixed
Show fixed
Hide fixed
.../org/hibernate/orm/test/envers/integration/collection/EntitySameMapKeyMultiMapValueTest.java
Fixed
Show fixed
Hide fixed
ab22c63 to
fd09d92
Compare
| em.getTransaction().commit(); | ||
| scope.inTransaction( em -> { | ||
| ComponentTestEntity cte1 = em.find( ComponentTestEntity.class, id1 ); | ||
| ComponentTestEntity cte2 = em.find( ComponentTestEntity.class, id2 ); |
Check notice
Code scanning / CodeQL
Unread local variable Note test
| @@ -222,4 +226,33 @@ | |||
| entityManager.close(); | |||
| } | |||
| } | |||
|
|
|||
| public static AuditStrategy getAuditStrategy(EntityManager entityManager) { | |||
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note test
getAuditStrategy
|
|
||
| private void assertEnumProperty(Class<?> entityClass, Class<?> typeClass, String propertyName, EnumType expectedType) { | ||
| doInJPA( this::entityManagerFactory, entityManager -> { | ||
| private void assertEnumProperty(EntityManagerFactoryScope scope, Class<?> entityClass, Class<?> typeClass, String propertyName, EnumType expectedType) { |
Check notice
Code scanning / CodeQL
Useless parameter Note test
...s/integration/entityNames/singleAssociatedNotAudited/ReadEntityAssociatedNotAuditedTest.java
Fixed
Show fixed
Hide fixed
...s/integration/entityNames/singleAssociatedNotAudited/ReadEntityAssociatedNotAuditedTest.java
Fixed
Show fixed
Hide fixed
9d5369c to
72e1f20
Compare
3315ec0 to
1abb681
Compare
|
Marking as ready for review, there are more tests to work on but we can start merging the JUnit extension work and what has already been migrated so far. |
.../src/test/java/org/hibernate/orm/test/envers/integration/hashcode/SetHashcodeChangeTest.java
Fixed
Show fixed
Hide fixed
...t/java/org/hibernate/orm/test/envers/integration/manytoone/lazy/ManyToOneLazyDeleteTest.java
Fixed
Show fixed
Hide fixed
.../org/hibernate/orm/test/envers/integration/manytoone/foreignkey/ForeignKeyExclusionTest.java
Fixed
Show fixed
Hide fixed
...test/java/org/hibernate/orm/test/envers/integration/manytomany/sametable/BasicSametable.java
Fixed
Show fixed
Hide fixed
.../src/test/java/org/hibernate/orm/test/envers/integration/manytomany/OrderColumnListTest.java
Show resolved
Hide resolved
.../src/test/java/org/hibernate/orm/test/envers/integration/manytomany/IndexColumnListTest.java
Show resolved
Hide resolved
1abb681 to
7350ee5
Compare
...orm/test/envers/integration/strategy/ValidityAuditStrategyComponentCollectionRevEndTest.java
Fixed
Show fixed
Hide fixed
...orm/test/envers/integration/strategy/ValidityAuditStrategyComponentCollectionRevEndTest.java
Fixed
Show fixed
Hide fixed
...est/java/org/hibernate/orm/test/envers/integration/tm/SessionInterceptorTransactionTest.java
Fixed
Show fixed
Hide fixed
...a/org/hibernate/orm/test/envers/integration/tm/SessionFactoryInterceptorTransactionTest.java
Fixed
Show fixed
Hide fixed
.../test/envers/integration/onetomany/inverseToSuperclass/OneToManyInverseToSuperclassTest.java
Fixed
Show fixed
Hide fixed
370b535 to
d1d17fe
Compare
- Created new envers-junit hooks and hibernate-testing changes - Migrated the `org.hibernate.orm.test.envers.integration` package
d1d17fe to
655349e
Compare
|
I don't see how these changes would cause the CI failures, so going to integrate upstream. |
https://hibernate.atlassian.net/browse/HHH-19871
Drafting a possible migration path for Envers tests from JUnit 4 -> 6. This approach is the "least invasive", adding on top of the existing hibernate-testing annotations like
@Jpaadding only the required Envers machinery, while relying on existing JUnit 6 features like@ClassTemplates to run tests with multiple audit strategies.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.